package com.gzhryc.pay.enums;

import com.gzhryc.common.config.I18nTools;

/**
 * 订单类型
 * 
 * @author zhanghao
 *
 */
public enum TradeType {

	Normal("普通支付"),PreAuthPay("预授权支付"),NativePay("Native支付");

	private String note;

	TradeType(String note) {
		this.note = note;
	}

	public String note() {
		I18nTools.I18n i18n = I18nTools.getCurrentI18n();
		if (i18n != null) {
			return i18n.get(this.name(), note);
		}
		return note;
	}

	public static String note(String name){
		try {
			TradeType tradeType = TradeType.valueOf(name);
			if (tradeType != null) {
				return tradeType.note();
			}
		}catch (Exception e){}
		return null;
	}
}
